<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  function fn(){
    var sum = 0;
    for(var i=0; i<arguments.length; i++){
      // console.log(arguments[i]);
      sum += arguments[i];
    }
    console.log(sum);
  }
  fn(3, 5);
  console.log("-----");
  fn(2, 4, 7, 8, 9);
  console.log("-----");
  fn(4, 1, 9);
  console.log("-----");
  
  // 0 ~ length-1
  // 递增


</script>
</html>